<!DOCTYPE html>
<html>
  <head>
    <title>客户报备</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
      <link rel="stylesheet" href="${s.base}/mobile/base/css/weui.min.css">
      <link rel="stylesheet" href="${s.base}/mobile/base/css/jquery-weui.css">
      <link rel="stylesheet" href="${s.base}/mobile/wechat/css/base.css">
      <link rel="stylesheet" href="${s.base}/mobile/wechat/css/component.css">
      <link rel="stylesheet" type="text/css" href="${s.base}/mobile/base/lib/DateSelector/DateSelector.css?rev=@@hash"/>
  </head>
  <body>
	<div class="xyg-comp-list-select">
        <input type="hidden" value="${currentHostItem.id}" name="itemId" id="itemId"/>
       <div class="xyg-comp-list-select-item" style="padding:0.2rem 5%;">
            <div class="xyg-comp-list-select-item-title"> 
             报备楼宇
            </div>
            <div class="xyg-comp-list-select-item-icon" id="hostItemTab">
             <span id="itemName"> ${currentHostItem.name!'选择楼宇'}</span>
             <!--<svg class="icon" aria-hidden="true">
              <use xlink:href="#iconxiangyou"></use>
             </svg> -->
            </div> 
       </div> 
       <div style="width: 100%;background: #f3f3f3; height: 0.5rem;">
	  </div>
       <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title"> 
             客户姓名
            </div>
             <div class="xyg-comp-list-select-item-content"> 
             <input type="text" placeholder="请填写客户姓名" id="name" value="${member.name}" />
            </div>
       </div> 
       <div class="xyg-comp-list-select-item">
           <input type="hidden" name="sex" id="sex"/>
            <div class="xyg-comp-list-select-item-title"> 
             性别
            </div>
            <div class="xyg-comp-list-select-item-icon" id="sexTab">
             <span id="sexName">请选择性别</span>
            <svg class="icon" aria-hidden="true"> 
              <use xlink:href="#iconxiangyou"></use>
             </svg>  
            </div> 
       </div> 
       <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title"> 
             客户电话
            </div>
             <div class="xyg-comp-list-select-item-content"> 
             <input type="text" id="phone" maxlength="12" placeholder="请先填写客户电话" />
            </div>
       </div> 
       <div style="width: 100%;background: #f3f3f3; height: 0.5rem;">
	  </div>
       <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title"> 
             到访时间
            </div>
           <div class="xyg-comp-list-select-item-content">
               <input type="text" id="useTime" readonly placeholder="请选择到访时间" />
               <div id="targetContainers"></div>
           </div>
       </div> 
       <div class="xyg-comp-list-select-item" style="height: 6rem;">
            <textarea style="width: 100%; height:5rem;border: 0px; margin-top: 0.5rem; line-height: 1rem;color: #999999;" id="remarks" placeholder="给项目经理留言..."></textarea>
       </div> 
  	</div>
   <div class="xyg-bottom">
    	<a href="javascript:submit();" class="weui-btn weui-btn_warn">申请提交</a>
    </div>

  <style type="text/css">
	  html,body{background:#f5f5f5;}
  	.xyg-comp-list-select{width:92%; margin: 0px 4%; height:auto;}
	  .xyg-comp-list-select .xyg-comp-pic{width:90%; padding:0.5rem 5%; background: #FFF;}
	  .xyg-comp-list-select .xyg-comp-pic-title{width:100%;line-height:1.5rem; padding-bottom: 0.5rem; font-size: 0.8rem; color:#000; letter-spacing: 0.01rem; }
	  .xyg-comp-list-select .xyg-comp-pic-title-left{width: 50%; height: 6rem; float: left;}
	   .xyg-comp-list-select .xyg-comp-pic-title-left img{width: 100%; height: 6rem;}
	   .xyg-comp-list-select .xyg-comp-pic-title-right{width: 50%; height: 6rem; float: left;}
	  
	.xyg-comp-list-select-item{width:90%; padding:0px 5%; line-height:2.2rem; height:2.2rem;font-size: 0.8rem; color:#000; letter-spacing: 0.01rem; background: #FFF; border: 0.001rem solid #f5f5f5;}
	  
 .xyg-comp-list-select-item textarea::-webkit-input-placeholder {
  /* WebKit browsers */
  color: #999999;
}
 .xyg-comp-list-select-item textarea:-moz-placeholder {
  /* Mozilla Firefox 4 to 18 */
  color: #999999;
}
 .xyg-comp-list-select-item textarea::-moz-placeholder {
  /* Mozilla Firefox 19+ */
  color: #999999;
}
 .xyg-comp-list-select-item textarea::-ms-input-placeholder {
  /* Internet Explorer 10+ */
	color: #999999;}
 

	  .xyg-comp-list-select-item input::-webkit-input-placeholder {color: #999999;}
	.xyg-comp-list-select-item .xyg-comp-list-select-item-icon{width:70%; line-height:2rem; text-align:right; float:left; color: #999999;}
	.xyg-comp-list-select-item .xyg-comp-list-select-item-title{width:30%; height:2rem; text-align:left; float:left;}
	.xyg-comp-list-select-item .xyg-comp-list-select-item-content{width:70%; height:2rem; text-align:left; float:left;}
	.xyg-comp-list-select-item .xyg-comp-list-select-item-content input{width:100%; height:2rem; line-height:2rem;background-color:transparent;border:0; text-align:right;}
	.xyg-comp-xy{height:2rem; line-height:2rem; width:width:93%; margin:0px 2% 0px 5%;}
	.xyg-bottom{width:90%; height:auto;  margin:1.5rem 5%;}
  </style>
  </body>
  <script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
  <script src="${s.base}/mobile/base/js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
  <script src="${s.base}/mobile/base/js/jquery-weui.js" type="text/javascript" charset="utf-8"></script>
  <script src="${s.base}/mobile/base/js/swiper.js" type="text/javascript" charset="utf-8"></script>
  <script src="${s.base}/mobile/base/js/component.js?12323434323232323232" type="text/javascript" charset="utf-8"></script>
  <script src="${s.base}/mobile/wechat/fonts/iconfont.js"></script>
  <script src="${s.base}/mobile/wechat/js/window_port.js"></script>
  <script src="${s.base}/mobile/wechat/js/base.js"></script>
  <script src="${s.base}/mobile/base/lib/DateSelector/DateSelector.js"></script>
  <script type="text/javascript">
      var currentCityId='${cityId}';
      var memberId='${memberId}';
      new DateSelector({
          input: 'useTime',//点击触发插件的input框的id
          container: 'targetContainers',//插件插入的容器id
          type: 1,
          param: [1, 1, 1, 1, 1],
          beginTime: [${currentDate?string('yyyy')}, ${currentDate?string('MM')}, ${currentDate?string('dd')}, ${currentDate?string('HH')}, ${currentDate?string('mm')}],//如空数组默认设置成1970年1月1日0时0分开始，如需要设置开始时间点，数组的值对应param参数的对应值。
          endTime: [2027, 5, 7, 12, 2],//如空数组默认设置成次年12月31日23时59分结束，如需要设置结束时间点，数组的值对应param参数的对应值。
          recentTime: [${currentDate?string('yyyy')}, ${currentDate?string('MM')}, (${currentDate?string('dd')})*1+1, ${currentDate?string('HH')}, ${currentDate?string('mm')}],
          success: function (arr, arr2) {
              $("#useTime").val(arr2[0]+"-"+arr2[1]+"-"+arr2[2]+" "+arr2[3]+":"+arr2[4])
          }//回调
      });
      $(document).ready(function(e) {
          initDate();
      });

      function initDate() {
          /*$("#hostItemTab").select({
              title: "切换楼宇",
              items:  ${itemSelect},
              onChange: function(d) {
                  $("#itemId").val(d.values);
                  $("#itemName").html(d.titles);
              }
          });*/
          $("#sexTab").select({
              title: "选择性别",
              items:[{
                  title: "男",
                  value: 1
              },
                  {
                      title: "女",
                      value: 2
                  },
              ],
              onChange: function(d) {
                  $("#sex").val(d.values);
                  $("#sexName").html(d.titles);
              }
          });
      }

      function submit() {
          var itemId = $("#itemId").val();
          if(itemId == null || itemId == "") {
              $.toast("请选择楼宇", "text");
              return false;
          }
          var name = $("#name").val();
          if(name == null || name == "") {
              $.toast("请填写客户信息", "text");
              return false;
          }
          var sex = $("#sex").val();
          if(sex == null || sex == "") {
              $.toast("请选型性别", "text");
              return false;
          }
          var phone = $("#phone").val();
          if(phone == null || phone == "") {
              $.toast("请输入手机号", "text");
              return false;
          }
          var useTime = $("#useTime").val();
          if(useTime == null || useTime == "") {
              $.toast("请选择到访时间", "text");
              return false;
          }
          var remarks = $("#remarks").val();
          $.fn.postMethodResult("/weChat/reportSave",{'itemId':itemId,'name':name,'sex':sex,'phone':phone,'useTimeStr':useTime,'remarks':remarks,'memberId':memberId},function (data) {
              $.alert("提交成功！",function () {
                 window.location.reload();
              });
          });
      }
  </script>
</html>

